<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
    <head>
        <base href="<%=basePath%>">
        <meta charset="UTF-8">
        <title>删除网点信息</title>
        <!--  easyui.css  -->
        <link rel="stylesheet" type="text/css" href="css/easyui/themes/default/easyui.css">
        <!--  icon.css  -->
        <link rel="stylesheet" type="text/css" href="css/easyui/themes/icon.css">
        <!--  color.css  -->
        <link rel="stylesheet" type="text/css" href="css/easyui/themes/color.css">
        <!--  demo.css  -->
        <link rel="stylesheet" type="text/css" href="css/easyui/demo/demo.css">
        <!--  jquery-1.6.min.js -->
        <script type="text/javascript" src="js/jquery/1.6/jquery-1.6.min.js"></script>
        <!--  jquery.easyui.min.js  -->
        <script type="text/javascript" src="js/easyui/1.4/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="js/easyui/1.4/easyui-lang-zh_CN.js"></script>
        <script type="text/javascript" src="js/easyui/1.4/common.js"></script>
    </head>
    <body>

        <table id="dg" title="删除车位" class="easyui-datagrid"
            style="width: 768px; height: 400px" url="admin/getNetWorkJson.do" toolbar="#toolbar"
            pagination="true" rownumbers="true" fitColumns="true" 
            singleSelect="true">
            <thead>
                <tr>
                    <th field="networkId" width="50" hidden="true">
                        网点Id
                    </th>
                    <th field="networkName" width="80" >
                        网点名称
                    </th>
                    <th field="networkParkSize" width="80">
                        车位数量
                    </th>
                    <th field="networkProvince" width="70">
                        网点省份
                    </th>
                    <th field="networkCity" width="70">
                        网点城市
                    </th>
                    <th field="networkArea" width="70">
                        网点地区
                    </th>
                    <th field="networkAddress" width="120">
                        网点地址
                    </th>
                    <th field="networkPrice" width="80">
                        单价(元/小时)
                    </th>
                    <th field="networkTimeBegin" width="60">
                        营业开始
                    </th>
                    <th field="networkTimeEnd" width="60">
                        营业结束
                    </th>
                    <th field="networkType" width="50" hidden="true">
                        网点类型
                    </th>
                    <th field="createDate" width="50" hidden="true">
                        创建时间
                    </th>
                    <th field="modifyDate" width="50" hidden="true">
                        修改时间
                    </th>
                    <th field="deleteDate" width="50" hidden="true">
                        删除时间
                    </th>
                    <th field="status" width="50" hidden="true">
                        记录状态
                    </th>
                </tr>
            </thead>
        </table>
        <div id="toolbar">
            <a href="javascript:void(0)" class="easyui-linkbutton"
                iconCls="icon-add" plain="true" onclick="deleteNetwork()">删除网点</a>
        </div>
        <script type="text/javascript">
var url;

function deleteNetwork() {
    var row = $('#dg').datagrid('getSelected');
    if (row) {
        $.messager.confirm('Confirm',
                '请问你确定要删除车位', function(r) {
                    if (r) {
                        $.post('admin/ajax_delete_network.do', {
                            networkId : row.networkId
                        }, function(result) {
                            if (result.flg) {
                                $.messager.alert('成功提示','成功删除网点（'+row.networkName+'）','info');
                                $('#dg').datagrid('reload'); // reload the user data
                            } else {
                                $.messager.show( { // show error message
                                            title : 'Error',
                                            msg : result.errorMsg
                                        });
                            }
                        }, 'json');
                    }
                });
    }
}
</script>
        <style type="text/css">
#fm {
    margin: 0;
    padding: 10px 30px;
}

.ftitle {
    font-size: 14px;
    font-weight: bold;
    padding: 5px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.fitem {
    margin-bottom: 5px;
}

.fitem label {
    display: inline-block;
    width: 80px;
}

.fitem input {
    width: 160px;
}
</style>
    </body>
</html>
